home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9901 < prev    next >
Encoding:
Text File  |  1996-08-05  |  920 b   |  41 lines

  1. Path: ix.netcom.com!netnews
  2. From: brenth@ix.netcom.com(harold brent hyatt)
  3. Newsgroups: comp.lang.c
  4. Subject: prototype error
  5. Date: 14 Mar 1996 04:10:48 GMT
  6. Organization: Netcom
  7. Message-ID: <4i8688$1gr@cloner4.netcom.com>
  8. NNTP-Posting-Host: sma-ca1-12.ix.netcom.com
  9. X-NETCOM-Date: Wed Mar 13  8:10:48 PM PST 1996
  10.  
  11. I copied this program from a C primer and get an error as follows:
  12. "Call to function sound, delay, nosound with no prototype."
  13. I'm using a Borland 3.1 C++ compiler in the EasyWin mode. I have
  14. tried switching the compiler from ANSI to Borland C++, but with the
  15. same result. What's wrong? Thanks.
  16.  
  17. #include <stdio.h>
  18. #include<conio.h>
  19. #include<dos.h>
  20.  
  21. void dropBomb (void);
  22.  
  23. main()
  24. {
  25.     printf("Press any key to drop bomb:\n");
  26.     getch();
  27.     dropBomb();
  28.     printf("\nYikes!\n");
  29. }
  30. void dropBomb()
  31. {
  32.     int x;
  33.  
  34.     for(x=880;x>440;x-=10)
  35.     {
  36.         sound(x);
  37.         delay(100);
  38.     }
  39.     nosound();
  40. }
  41.